package com.cjkj.system.api;

import com.cjkj.common.core.constant.SecurityConstants;
import com.cjkj.common.core.constant.ServiceNameConstants;
import com.cjkj.common.core.domain.R;
import com.cjkj.system.api.domain.APIMonitorPadData;
import com.cjkj.system.api.domain.MonitorPadRecords;
import com.cjkj.system.api.domain.SleepStageRecords;
import com.cjkj.system.api.domain.request.EquipmentHDAReq;
import com.cjkj.system.api.domain.request.PatientEquipmentRTDReq;
import com.cjkj.system.api.domain.request.RecordsReq;
import com.cjkj.system.api.domain.request.SleepStageReq;
import com.cjkj.system.api.factory.RemoteTJ01DataServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "remoteTJ01DataService",value = ServiceNameConstants.EQUIPMENT_SERVICE, fallbackFactory = RemoteTJ01DataServiceFallbackFactory.class )
public interface RemoteTJ01DataService {

    /**
     * 查询睡眠状态列表
     **/
    @PostMapping("/report/tj01StageRecords")
    R<SleepStageRecords> tj01StageRecords(@RequestBody SleepStageReq sleepStageReq, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    /**
     * 根据就诊号，时间，查询睡眠监测的记录
     **/
    @PostMapping("/report/tj01Data")
    R<MonitorPadRecords> tj01Data(@RequestBody RecordsReq req, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    /**
     * 开单使用期间的最新一条实时数据
     * @param req
     * @param source
     * @return
     */
    @PostMapping("/equipment/getLastMonitorPadDataInUse")
    R<APIMonitorPadData> getLastMonitorPadDataInUse(@RequestBody PatientEquipmentRTDReq req,
                                                    @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/equipment/listEquipmentHDA")
    R<Object> appListEquipmentHDA(@RequestBody EquipmentHDAReq req);
}
